<template>
  <div id="app">
    <el-container>
      <el-header>
        <img src="../assets/admin.jpeg" alt="logo" class="logo" />
        <div class="loginOut"><LoginOut :username="username" /></div>
      </el-header>
      <el-container class="content">
        <el-aside width="200px"><Nav /></el-aside>
        <el-main><router-view></router-view></el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import Nav from "../components/Nav.vue";
import LoginOut from "../components/LoginOut.vue";
import "../assets/css/index.css";
export default {
  name: "Index",
  data() {
    return {
      username: null,
    };
  },
  components: {
    Nav,
    LoginOut,
  },
  created() {
    this.username=sessionStorage.getItem('username')
  },
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
}

.el-header {
  background-color: rgb(84, 92, 100);
  color: white;
  text-align: center;
  line-height: 60px;
}
.content {
  height: 1080px;
}
.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
  height: 100%;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.logo {
  width: 160px;
  height: 30px;
  padding: 10px;
  float: left;
  /* border: 1px solid red; */
}
.loginOut {
  float: right;
  color: white;
  font-size: 12px;
}
</style>
